# -*- coding:GBK -*-

import math
import math3d
import brick_baseobj
import brick_nwall
import iworld2d
import iphy2d
import brick_nsettings

MAP_SCALE = brick_baseobj.MAP_SCALE

class CBottomLineObj(brick_nwall.CWallObj):
    def __init__(self):
        boardpos = list(brick_nsettings.settingdata["nboard_startpos"])
        leftwallpos = list(brick_nsettings.settingdata["nwall_leftpos"])
        rightwallpos = list(brick_nsettings.settingdata["nwall_rightpos"])
        leftx = leftwallpos[0]
        rightx = rightwallpos[0]
        pos = (0.5*(leftx+rightx),boardpos[1]+1)
        halfwidth = 0.5*(rightx-leftx)
        halfheight = 1
        super(CBottomLineObj, self).__init__(pos, halfwidth, halfheight)
        self.name = "bottomline"
        self.create_face(brick_nsettings.settingdata["nboard_facedir"])
        
    def on_hit(self, by_obj):
        if by_obj.name == "ball":
            self.destroy()